<?php
set_time_limit(0);

define('IN_ADAGPS', TRUE);   
define('ROOT_PATH', '../');
define('CORE_PATH', ROOT_PATH.'core/');
//define('MODULE_PATH', ROOT_PATH.'modules/');
//define('TEMPL_PATH', ROOT_PATH.'templates/');
include_once('cfg.php');
include_once(CORE_PATH.'includes/functions.php');
include_once(CORE_PATH.'includes/function_summary.php');  
include_once(CORE_PATH.'includes/constants_vi.php'); 
include_once(CORE_PATH.'includes/functions_date.php');                                  
include_once(CORE_PATH.'classes/adodb/adodb.inc.php');

if (!ConnectDB()) {
    WriteAppendLog('C:\ADAGPS_Service_ada\SumFuelLogs.txt', 'Can not connect to database.');
    exit();
}
$oTbs = new clsTinyButStrong();
$sql = "select ifnull(t.`name`,'0') as name, ifnull(t.`username`,'0') as username, ifnull(t.`latitude1`,0) latitude1, ifnull(t.`longitude1`,0) longitude1  from tbl_locations as t ";
$arr = $objDbSelect->GetArray($sql);

$oTbs ->LoadTemplate("xmlfile/coffee_file.html");
$oTbs->MergeBlock('blk_list', $arr);      
$fp = fopen('coffee_file.xml', 'w');
fwrite($fp,$oTbs->Source);
fclose($fp);

// the content of 'data.txt' is now 123 and not 23!
?>


